package com.zsrt.java.day20161229.cg.practice.demo02;

import java.util.Scanner;


public class hanShuX {

	public static void main(String[] args) {
		int x ;
		int y;
		Scanner s = new Scanner(System.in);
		System.out.println("请输入一个整数");
		x = s.nextInt();
		s.close();
		if(x < 0){
			y = x * x + 6*x -1;
			System.out.println("公式为: y = y =x * x + 6*x -1  \n  y=" + y);
		}else if(x<3){
			y = x*x + 3*x +1;
			System.out.println("公式为: x*x + 3*x +1  \n  y=" + y);
		}else if(x<10){
			y= x*x;
			System.out.println("公式为: x*x  \n  y=" + y);
		}else {
			y = x*x-x-1;
			System.out.println("公式为: x*x-x-1  \n  y=" + y);
			
		}
	}
}
